<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>区域管理编辑</title>
	<!-- import css and js --> 
	<%@ include file="/common/metaInput.jsp" %>  
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
<script type="text/javascript">
var basic_Url="${ctx}/yd/basic/company";
$(function(){
$("#inputForm").validate({			   
	onsubmit: true,
	 /*执行ajaxsubmit  */ 
    submitHandler: function(editform) {
            
        //alert(jsonInfo); 
        try{			    		
            url =  basic_Url+"/save.do";
            var api = frameElement.api;
        	var W = api.opener;
        
            getReturnMessage(url,"inputForm",W.searchAP);
        }catch(e){alert(e)}
    }
 }
);

if ('${flag}' == 'EDIT'){
	 $("#code").attr("disabled","disabled");//禁用SELECT标签
}

/* $("#storage").change(function(){ 
	  $("#parentid").val($("#storage").val());
	  $("#parentname").val($("#storage").find("option:selected").text());
	}); */

}) 


function submitForm(param){
    //设置ajax全局同步
	jQuery.ajaxSettings.async = false;
  	$("#submitFlag").val(param);
    $("#inputForm").submit();
 }		
	
</script>

</head>

<body>

<form id="inputForm" action="" method="post">
<input type="hidden" id="id" name="id" value="${company.id}"/>
<input type="hidden" id="type" name="type" value="${type}"/>
<!-- 用于标识提交按钮 -->
<input type="hidden" id="submitFlag" value="" />
 <div class="pageContent" >
    <div class="panel">
         <table class="TableBlock" align="center">
                   <tr>
                    <td nowrap>名称:</td>
   		                 <td>
   		                <input type="text" id="name" name="name" style="width: 40%;" class="required" value="${company.name}" />
   		                 </td>
   		           </tr>
   		           <tr>
	           			<td nowrap>助记码:</td>
		                <td>
		                	<input type="text"  id="bizMnemonic" size="40%" name="bizMnemonic"  />
		                </td>
	           		</tr>
   		           <tr>
                    <td nowrap>编码:</td>
   		                 <td>
   		                <input type="text" id="code" name="code" style="width: 40%;"  value="${company.code}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>类别:</td>
   		                 <td>
   		                <select id="storage" name="storage" style="width: 40%;" class="required">
   		                 	
   		                 	<c:forEach items='${companytype}' var='state'>
   		                 	<option id="${ state.id}" value='${state.id}'>${state.name}</option>
   		                 	</c:forEach>
   		                 	</select>
   		                 	<input type="hidden" id="parentid" name="parentid" value="${company.parentid}"/>
   		                 	<input type="hidden" id="parentname" name="parentname" value="${company.parentname}"/>
   		                 	<script type="text/javascript">
   		                		 $("#"+'${company.parentid}').attr("selected","selected");
   		                	  $("#parentid").val($("#storage").val());
   		             	  $("#parentname").val($("#storage").find("option:selected").text());
   		                 	</script>
   		                 </td>
   		           </tr>
   		            <tr>
   		            <td nowrap>开户行:</td>
   		                 <td>
   		                <input type="text" id="bankDeposit" name="bankDeposit" style="width: 40%;" value="${company.bankDeposit}" />
   		                 </td>
   		           </tr>
   		           <tr>
   		           <td nowrap>银行账号:</td>
   		                 <td>
   		                <input type="text" id="accountNum" name="accountNum" style="width: 40%;" value="${company.accountNum}" />
   		                 </td>
   		           </tr>
   		           <tr>
   		           <td nowrap>账户名称:</td>
   		                 <td>
   		                <input type="text" id="accountName" name="accountName" style="width: 40%;" value="${company.accountName}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>性质:</td>
   		                 <td>
   		                <input type="text" id="nature" name="nature" style="width: 40%;" value="${company.nature}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>联系人:</td>
   		                 <td>
   		                <input type="text" id="attachperson" name="attachperson" style="width: 40%;" class="required" value="${company.attachperson}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>邮箱:</td>
   		                 <td>
   		                <input type="text" id="email" name="email" style="width: 40%;" value="${company.email}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>电话:</td>
   		                 <td>
   		                <input type="text" id="telephone" name="telephone" style="width: 40%;" class="required" value="${company.telephone}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>手机:</td>
   		                 <td>
   		                <input type="text" id="mobil" name="mobil" style="width: 40%;" class="required" value="${company.mobil}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>传真:</td>
   		                 <td>
   		                <input type="text" id="fax" name="fax" style="width: 40%;" value="${company.fax}" />
   		                 </td>
   		           </tr>
   		           <tr>
                    <td nowrap>地址:</td>
   		                 <td>
   		                <input type="text" id="address" name="address" style="width: 40%;" value="${company.address}" />
   		                 </td>
   		           </tr>
   		           <tr>
   		           	<td nowrap>描叙:</td>
   		           	<td colspan="3"><input id="simplejakecn" name="simplejakecn" style="width: 40%;" value="${company.simplejakecn}" /></td>
   		           </tr>
   		           <tr>
   		           	<td nowrap>备注:</td>
   		           	<td colspan="3"><input id="remark" name="remark" style="width: 40%;" value="${company.remark}" /></td>
   		           </tr>
                </table>               
         </div>
         <div class="formBar">
	        <ul>
		       <li><div class="buttonActive"><div class="buttonContent"><button type="button" id="save" onclick="submitForm(1)">保存</button></div></div></li>
		       <li><div class="button"><div class="buttonContent"><button type="button" class="print" onclick="CloseDialog()">关闭</button></div></div></li>
	        </ul>
        </div>    
    </div>
</form>
</body>
</html>
